From e3993769c0bd5606118ac8be564d71f3d34598b9 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 31 Jul 2004 22:20:02 +0000 Subject: [PATCH] bitkeeper revision 1.1108.45.2 (410c1b12fr5E-nBaA3zFwFnI4yp4yg) Hack to work around Python 2.2's lack of gnu style getopt parsing. --- BitKeeper/etc/ignore | 17 +++++++---------- tools/python/xen/xm/opts.py | 9 +++++++++ 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index aa55ed6b09..8ad837b7f0 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -12,16 +12,13 @@ PENDING/* TAGS Twisted-1.3.0 Twisted-1.3.0.tar.gz -docs/interface.aux -docs/interface.log -docs/interface.pdf -docs/interface.ps -docs/interface.toc -docs/user.aux -docs/user.log -docs/user.pdf -docs/user.ps -docs/user.toc +docs/*.aux +docs/*.log +docs/*.pdf +docs/*.ps +docs/*.toc +docs/interface/* +docs/user/* extras/mini-os/h/hypervisor-ifs install install/* diff --git a/tools/python/xen/xm/opts.py b/tools/python/xen/xm/opts.py index 4523775b65..9f34b6773c 100644 --- a/tools/python/xen/xm/opts.py +++ b/tools/python/xen/xm/opts.py @@ -273,10 +273,19 @@ class Opts: return remaining arguments """ self.argv = argv + try: (vals, args) = getopt(argv[1:], self.short_opts(), self.long_opts()) except GetoptError, err: self.err(str(err)) + + # hack to work around lack of gnu getopts parsing in python 2.2 + xargs = args + while xargs[1:]: + (v,xargs) = getopt(xargs[1:], self.short_opts(), self.long_opts()) + vals = vals + v + + # back to the real work self.args = args for (k, v) in vals: for opt in self.options: -- 2.30.2